home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’95 / Spy / DS Additions.h next >
Text File  |  1995-09-10  |  2KB  |  48 lines

  1. /********************************************************************************
  2.     
  3.     File:  DS Additions.h
  4.  
  5.     Copyright 1994-1995 Natural Intelligence, Inc. and Christopher Evans
  6.     
  7. *********************************************************************************/
  8. #include "Drag.h"
  9. #include <Aliases.h>
  10.  
  11. #pragma once
  12.  
  13. typedef struct {
  14.     short            dsMessage;            //message being passed to the addition
  15.     WindowPtr        dsWindow;            //WindowPtr of the window containing the addition
  16.     Rect            dsLocalRect;        //Rect where the addition exists in the window.  Use this for drawing
  17.     DragReference    dsDragReference;    //DragReference when dsMessage == kMsgDropOccurred
  18.     unsigned long    dsNextDrawTime;        //System time in ticks when you would like your next draw message.  Set this before returning from a kMsgDraw or kMsgDrawHilite message
  19.     long            dsRefCon;            //Refcon for your use.
  20.     short            dsVersion;            //Version of the external API.  Set to current kCurrentAdditionInterfaceVersion
  21.     short            dsItemId;            //Resource id for this items resources in the strip file
  22.     short            dsItemFileResId;    //Resource ref num for the strips resource fork.
  23.     Rect            dsIconRect;            //Preferred Rect in which to draw an icon (based on current icon style)
  24.     Rect            dsTextRect;            //Preferred Rect in which to draw text (based on current icon style)
  25. }DSAdditionParamBlock, *DSAdditionParamBlockPtr;
  26.  
  27.  
  28. #define kCurrentAdditionInterfaceVersion 3
  29.  
  30. #define kDSAdditionFileType        'DSt+'
  31. #define kDSAdditionDrawFileType    'DStd'
  32. #define kDSAdditionResType        'DSad'
  33.  
  34.  
  35. typedef pascal long (*DSAdditionProcPtr)(DSAdditionParamBlockPtr params);
  36.  
  37. typedef enum {
  38.     kMsgInitAddition = -2,
  39.     kMsgCloseAddition = -1,
  40.     kMsgHit = 1,
  41.     kMsgDropOccurred,
  42.     kMsgDraw,
  43.     kMsgDrawHilite
  44. } DSMessages;
  45.  
  46.  
  47.  
  48.